package com.pine.app.module.security.oauth.support.password;

import com.pine.app.module.security.core.common.AuthConstant;
import com.pine.app.module.security.oauth.support.AbstractHttpTokenRequest;

import javax.servlet.http.HttpServletRequest;


/**
 * @author xiaoyuan
 * @create 2019/9/30 9:30
 **/
public class HttpPasswordRequest extends AbstractHttpTokenRequest implements PasswordRequest {
   private String username;
   private String password;
    public HttpPasswordRequest(HttpServletRequest request) {
        super(request);
        username = getParameter(AuthConstant.username).orElse("");
        password = getParameter(AuthConstant.password).orElse("");
    }

    @Override
    public String getUsername() {
        return username;
    }

    @Override
    public String getPassword() {
        return password;
    }

}
